/*
 * @Author: White
 * @description: 路由
 * @LastEditTime: 2021-08-19 15:38:22
 */

import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Index',
    component: () => import('../views/Index.vue'),
    children: [
      {
        path: '',
        redirect: { name: 'add' }
      },
      {
        path: '/add',
        name: 'add',
        component: () => import('../components/Add.vue')
      },
      {
        path: '/done',
        name: 'done',
        component: () => import('../components/Done.vue')
      },
      {
        path: '/delete',
        name: 'delete',
        component: () => import('../components/Delete.vue')
      },
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
  linkActiveClass: 'active'
})

export default router
